using mock_ehr_lib.Model.Infobutton;
using mock_ehr_lib;
using System.Linq;

namespace mock_ehr_web.Models
{
    public static class ModelExt
    {
        public static string GetInfobuttonUrl(this IInfobuttonProvider provider)
        {
            var parameters = provider.GetParameters();
            if(parameters.Length > 0)
            {
                var paramString = parameters.Aggregate("", (s, p) => s + string.Format("&{0}={1}", p.Name, p.Value));
                return MockEHRApplication.Instance.InfoButtonBaseUrl + paramString;
            }
            return null;
        }
    }

    public class Order
    {
        
    }
    
}